from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_list
from django.views.generic.simple import direct_to_template

from models import Category, Thread

urlpatterns = patterns('',
    #Category CRD URLs
    url(r'^content/$', 'threadedforum.views.category_list', name="tf_categories"),
    url(r'^content/(?P<slug>[a-zA-Z0-9_-]+)/$', 'threadedforum.views.category', name="tf_category"),
    url(r'^create_category/$', 'threadedforum.views.category_create_or_update', name="tf_category_create"),
    url(r'^update_category/(?P<slug>[a-zA-Z0-9_-]+)$', 'threadedforum.views.category_create_or_update', name="tf_category_update"),

    #Thread CRD URLs
    url(r'^content/(?P<category_slug>[a-zA-Z0-9_-]+)/(?P<object_id>[0-9]+)/$', 'threadedforum.views.thread', name="tf_thread"),
    url(r'^content/(?P<category_slug>[a-zA-Z0-9_-]+)/thread_create/$', 'threadedforum.views.thread_create_or_update', name='tf_thread_create'),
    url(r'^content/(?P<category_slug>[a-zA-Z0-9_-]+)/(?P<object_id>[0-9]+)/thread_update/$', 'threadedforum.views.thread_create_or_update', name="tf_thread_update"),
    url(r'^content/(?P<category_slug>[a-zA-Z0-9_-]+)/(?P<object_id>[0-9]+)/thread_delete/$', 'threadedforum.views.thread_delete', name='tf_thread_delete'),
    
    #Administrative URLs
    url(r'^denied/$', 'threadedforum.views.category_list', name="tf_denied"),
)